#########################################################
## Mod Title:  Drop Down Smilie MOD Part 1	
## Mod Version: 1.1.7
## Author:       radmanics <radmanics@dial.pipex.com> (David Race) http://members.lycos.co.uk/coolcodesportal/
## Description:  Makes a select, drop down box, which
##		 contains a list of all the smilies
##		 installed on you board. When you select
##		 a smiley, it appears next to the box.
##		 The smiliey code is then inserted to the
##		 like normal (by clicking on it)
## 
## Installation Level:  Easy 
## Installation Time:   1 minute
## Files To Edit:       templates/????/posting_body.tpl
##
######################################################### 
## Security Disclaimer: This MOD Cannot Be Posted To Or Added At Any Non-Official phpBB Sites 
#########################################################
## Notes: This MOD is inspired (and some of it is modified code) of the UBB
##	  version. It uses the smiliy's name in the select box though.
##	  Be careful not to alter ANY of the javascript unless you know what
##	  you are doing, and have a good reason for it, other wise the MOD wont
##	  work AT ALL!!!! so be careful :)
#########################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
#########################################################

# 
#---- [ OPEN ] -------- 
# 

posting_body.tpl 

# 
#----- [ FIND (line 98 - 108) ] ---- 
# 

function emoticon(text) {
	text = ' ' + text + ' ';
	if (document.post.message.createTextRange && document.post.message.caretPos) {
		var caretPos = document.post.message.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
		document.post.message.focus();
	} else {
	document.post.message.value  += text;
	document.post.message.focus();
	}
}


# 
#---- [ ADD AFTER ] ---- 
# 

//Drop Down Smilie MOD (c) radmanics 2002

//this is the function to change the image, taken from phpBB2.0.0 smilie admin pannel
function update_smiley(newimage)
{
	document.smiley_image.src = "{S_SMILEY_BASEDIR}/" + newimage;
}

//this is the function to add the smiley code, taken and modified from the UBB version.
function emoticon_drop(text) {
  emoticon_code = "" + text;
  current_msg = document.post.message.value;

  document.post.message.value = current_msg+emoticon_code;
  document.post.message.focus();
  return;
}

function emoticon_code_help(help) {
	document.post.emoticon_code_box.value = "{L_SMILEY_CODE}" + help;
}

//end MOD

# 
# --- [ FIND (line 316 - 338) ] ---- 
# 

		<table width="100%" border="0" cellspacing="0" cellpadding="1">
		  <tr> 
			<td><span class="gen"><b>{L_MESSAGE_BODY}</b></span> </td>
		  </tr>
		  <tr> 
			<td valign="middle" align="center"> <br />
			  <table width="100" border="0" cellspacing="0" cellpadding="5">
				<tr align="center"> 
				  <td colspan="{S_SMILIES_COLSPAN}" class="gensmall"><b>{L_EMOTICONS}</b></td>
				</tr>
				<!-- BEGIN smilies_row -->
				<tr align="center" valign="middle"> 
				  <!-- BEGIN smilies_col -->
                  <td><img src="{smilies_row.smilies_col.SMILEY_IMG}" border="0" onmouseover="this.style.cursor='hand';" onclick="emoticon('{smilies_row.smilies_col.SMILEY_CODE}');" alt="{smilies_row.smilies_col.SMILEY_DESC}" title="{smilies_row.smilies_col.SMILEY_DESC}" /></a></td>
				  <!-- END smilies_col -->
				</tr>
				<!-- END smilies_row -->
				<!-- BEGIN switch_smilies_extra -->
				<tr align="center"> 
				  <td colspan="{S_SMILIES_COLSPAN}"><span  class="nav"><a href="{U_MORE_SMILIES}" onclick="window.open('{U_MORE_SMILIES}', '_phpbbsmilies', 'HEIGHT=300,resizable=yes,scrollbars=yes,WIDTH=250');return false;" target="_phpbbsmilies" class="nav">{L_MORE_SMILIES}</a></td>
				</tr>
				<!-- END switch_smilies_extra -->
			  </table>
			</td>
		  </tr>
		</table>

#
#-----[ REPLACE WITH ] -----
#

		<table width="100%" border="0" cellspacing="0" cellpadding="1">
		  <tr> 
			<td><span class="gen"><b>{L_MESSAGE_BODY}</b></span> </td>
		  </tr>
		  <tr> 
	  		<td class="gensmall" align="center"><br><b>{L_EMOTICONS}</b><br><br></td>
		  </tr>
		  <tr> 
	  		<td align="center"><span class="gensmall"> 
				<select name='smile_url' onchange="update_smiley(this.options[selectedIndex].value);" onmouseover="emoticon_code_help(this.options[selectedIndex].id)";>{S_SMILEY_BLOCK}</select><img name="smiley_image" src="{S_SMILEY_NULL}" border="0" onclick="emoticon_drop(document.post.smile_url.options[document.post.smile_url.selectedIndex].id)" onmouseover="emoticon_code_help(document.post.smile_url.options[document.post.smile_url.selectedIndex].id)"><br><br>
	   		</td>
		  </tr>
		  <!-- BEGIN switch_smilies_extra -->
		  <tr align="center"> 
			<td colspan="{S_SMILIES_COLSPAN}"><span  class="nav"><a href="{U_MORE_SMILIES}" onclick="window.open('{U_MORE_SMILIES}', '_phpbbsmilies', 'HEIGHT=300,resizable=yes,scrollbars=yes,WIDTH=250');return false;" target="_phpbbsmilies" class="nav">{L_MORE_SMILIES}</a></td>
		  </tr>
		  <!-- END switch_smilies_extra -->
		</table>

# 
# --- [ FIND ] ---- 
# 

			  <input type="text" name="helpbox" size="45" maxlength="100" style="width:450px; font-size:10px" class="helpline" value="{L_STYLES_TIP}" />

# 
#---- [ ADD AFTER ] ---- 
# 

			  <br><input type="text" name="emoticon_code_box" size="45" maxlength="100" style="width:450px; font-size:10px;" class="helpline" value="{L_S_CODE_TIP}" /></span></td>

# 
#-----[ SAVE ALL FILES ]------------------------------------------ 
# 
# EOM.

